<div class="block">
	<ul class="tabList">
    	<li class="active"><a href="#news-detail">{{helper:lang line='news:tab:tab_detail'}}</a></li>
        <li><a href="#news-categories">{{helper:lang line='news:tab:categories'}}</a></li>      
		<li><a href="#news-metadata">{{helper:lang line='global:metadata'}}</a></li>
	</ul>
    <!-- tabList -->
    <div class="tabContent"> 
	    <?php 
		$attributes = array('class' => 'form_inputs adminForm ', 'id' => '');
		$hidden = array('id' => $model['id']);
		echo form_open_multipart('',$attributes,$hidden) //form_open //form_open_multipart?>
    	<div id="news-detail">
        	<?php echo validation_errors('<p class="error">', '</p>'); ?>
            <table class="tableForm" width="100%" cellspacing="0" cellpadding="0" border="0">
            <tbody>
                <tr>
                    <td width="120">
                        <?php echo form_label(lang('global:title'),'title')?>
                    </td>
                    <td>
                        <?php 
                        $data = array('name'=>'title','id'=>'title','value'=> $model['title'],'maxlength'=>255,'class'=>'inputText large');
                        echo form_input($data)?>
                    </td>
            	</tr>
                <tr>
                    <td width="120">
                        <?php echo form_label(lang('global:slug'),'slug')?>
                    </td>
                    <td>
                        <?php 
                        $data = array('name'=>'slug','id'=>'slug','value'=> $model['slug'],'maxlength'=>255,'class'=>'inputText large');
                        echo form_input($data)?>
                    </td>
                </tr>
                <tr>
                    <td><?php echo form_label(lang('global:image'),'image')?></td>
                    <td><input type="file" name="upload" /></td>
                </tr>
                <?php if($model['id']){?>
                <tr>    
                    <td></td>
                    <td>        
                        <img width="100" src="{{news:news_image: file = '<?php echo $model['image'] ?>' }}"  />
                    </td>
                </tr>	
                <?php } ?>
                <tr>    
                    <td><label for="bodyhtml">{{helper:lang line='global:description'}}</label></td>
                    <td><?php 
	    				$data = array('name'=>'description','id'=>'description','value'=> $model['description'],'class'=>'large', 'rows'=>4,'cols'=>80);
	   					echo form_textarea($data);?>
					</td>
                </tr>
                <tr>    
                    <td><label for="bodyhtml">{{helper:lang line='global:content'}}</label></td>
                    <td><?php 
	    				$data = array('name'=>'bodyhtml','id'=>'bodyhtml','value'=> $model['bodyhtml'],'class'=>'ckeditor large', 'rows'=>10,'cols'=>80);
	   					echo form_textarea($data);?>
					</td>
                </tr>
            </tbody>
            </table>
        </div>
        <div id="news-categories">
        	<table class="tableForm" width="100%" cellspacing="0" cellpadding="0" border="0">
        	<tr>
                <td class="ve-top"><?php echo form_label(lang('news:categories'),'cat_id')?></td>
                <td><ul class="list-radio tree">{{categories_radio}}</ul></td>
            </tr>
            </table>
        </div><!--news-categories-->
        <div id="news-metadata">
        <table class="tableForm">
        <tr>    
                    <td><label for="bodyhtml">{{helper:lang line='global:keywords'}}</label></td>
                    <td><?php 
	    				$data = array('name'=>'keywords','id'=>'keywords','value'=> $model['keywords'],'class'=>'large', 'rows'=>2,'cols'=>80);
	   					echo form_textarea($data);?>
					</td>
                </tr>
        </table>
        </div><!--news-metadata-->
        {{ theme:partial name="_form_button" }}
		<?php echo form_close()?>
    </div>
</div>

<script type="text/javascript">
$(".tabList").tabify();
$cat_id = '{{cat_id}}';
$('input[name="cat_id"][value='+$cat_id+']').attr('checked',true);
</script>